/**
 * 
 */
package com.thor.palmmall.rest.todo.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.todo.AQueryCountParam;
import com.thor.palmmall.spi.todo.SQueryCountParam;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class SQueryCountParamConverter implements Converter<AQueryCountParam, SQueryCountParam> {

  public static SQueryCountParamConverter getInstance() {
    if (instance == null)
      instance = new SQueryCountParamConverter();
    return instance;
  }

  private static SQueryCountParamConverter instance;

  private SQueryCountParamConverter() {
  }

  @Override
  public SQueryCountParam convert(AQueryCountParam source) {
    if (source == null) {
      return null;
    }
    SQueryCountParam target = new SQueryCountParam();
    target.setTaskType(source.getTaskType());
    target.setUserId(source.getUserId());
    return target;
  }

}
